from tortoise import BaseDBAsyncClient


async def upgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `icon` VARCHAR(100) NOT NULL COMMENT '菜单图标';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `name` VARCHAR(100) NOT NULL COMMENT '别名';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `type` VARCHAR(100) NOT NULL COMMENT '菜单类型';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `component` VARCHAR(100) NOT NULL COMMENT '组件';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `path` VARCHAR(100) NOT NULL COMMENT '菜单路径';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `title` VARCHAR(20) NOT NULL COMMENT '显示名称';"""


async def downgrade(db: BaseDBAsyncClient) -> str:
    return """
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `icon` VARCHAR(100) COMMENT '菜单图标';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `name` VARCHAR(100) COMMENT '别名';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `type` VARCHAR(100) COMMENT '菜单类型';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `component` VARCHAR(100) COMMENT '组件';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `path` VARCHAR(100) COMMENT '菜单路径';
        ALTER TABLE `tb_system_menu` MODIFY COLUMN `title` VARCHAR(20) COMMENT '显示名称';"""
